From: awilliam@xenbuild2.aw Date: Mon, 5 Feb 2007 21:24:27 +0000 (-0700) Subject: [IA64] Fix tlbflush_clock X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15356 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=570b1fe16eb2edd4a9eeae83ab1e075fd9d899a3;p=xen.git [IA64] Fix tlbflush_clock arch_vcpu.tlbflush_timestamp is unused and new_tlbflush_clock_period() flushes vhpt unnecessarily. Signed-off-by: Isaku Yamahata --- diff --git a/xen/arch/ia64/xen/domain.c b/xen/arch/ia64/xen/domain.c index 4f870ff7cd..6b76df3e58 100644 --- a/xen/arch/ia64/xen/domain.c +++ b/xen/arch/ia64/xen/domain.c @@ -448,9 +448,6 @@ int vcpu_late_initialise(struct vcpu *v) assign_domain_page(d, IA64_XMAPPEDREGS_PADDR(v->vcpu_id) + i, virt_to_maddr(v->arch.privregs + i)); - tlbflush_update_time(&v->arch.tlbflush_timestamp, - tlbflush_current_time()); - return 0; } diff --git a/xen/arch/ia64/xen/flushtlb.c b/xen/arch/ia64/xen/flushtlb.c index c7008db3ff..19aabf6c50 100644 --- a/xen/arch/ia64/xen/flushtlb.c +++ b/xen/arch/ia64/xen/flushtlb.c @@ -59,46 +59,18 @@ tlbflush_clock_inc_and_return(void) return t2; } +static void +tlbflush_clock_local_flush(void *unused) +{ + local_vhpt_flush(); + local_flush_tlb_all(); +} + void new_tlbflush_clock_period(void) { - /* - *XXX TODO - * If flushing all vcpu's vhpt takes too long, it can be done backgroundly. - * In such case tlbflush time comparison is done using only 31bit - * similar to linux jiffies comparison. - * vhpt should be flushed gradually before wraping 31bits. - * - * Sample calculation. - * Currently Xen/IA64 can create up to 64 domains at the same time. - * Vhpt size is currently 64KB. (This might be changed later though) - * Suppose each domains have 4 vcpus (or 16 vcpus). - * then the memory size which must be flushed is 16MB (64MB). - */ - struct domain* d; - struct vcpu* v; - /* flush all vhpt of vcpu of all existing domain. */ - read_lock(&domlist_lock); - for_each_domain(d) { - for_each_vcpu(d, v) { - vcpu_purge_tr_entry(&PSCBX(v,dtlb)); - vcpu_purge_tr_entry(&PSCBX(v,itlb)); - } - } - smp_mb(); - for_each_domain(d) { - for_each_vcpu(d, v) { - if (!test_bit(_VCPUF_initialised, &v->vcpu_flags) || VMX_DOMAIN(v)) - continue; - if (HAS_PERVCPU_VHPT(v->domain)) - vcpu_vhpt_flush(v); - } - } - read_unlock(&domlist_lock); - /* unlock has release semantics */ - /* flush all vhpt of physical cpu and mTLB */ - on_each_cpu((void (*)(void *))local_flush_tlb_all, NULL, 1, 1); + on_each_cpu(tlbflush_clock_local_flush, NULL, 1, 1); /* * if global TLB shootdown is finished, increment tlbflush_time diff --git a/xen/arch/ia64/xen/vhpt.c b/xen/arch/ia64/xen/vhpt.c index 67341328de..d5bae1156a 100644 --- a/xen/arch/ia64/xen/vhpt.c +++ b/xen/arch/ia64/xen/vhpt.c @@ -54,11 +54,7 @@ local_vhpt_flush(void) void vcpu_vhpt_flush(struct vcpu* v) { - /* increment flush clock before flush */ - u32 flush_time = tlbflush_clock_inc_and_return(); __vhpt_flush(vcpu_vhpt_maddr(v)); - /* this must be after flush */ - tlbflush_update_time(&v->arch.tlbflush_timestamp, flush_time); perfc_incrc(vcpu_vhpt_flush); } diff --git a/xen/include/asm-ia64/domain.h b/xen/include/asm-ia64/domain.h index 82a54c28b5..ce734c8677 100644 --- a/xen/include/asm-ia64/domain.h +++ b/xen/include/asm-ia64/domain.h @@ -200,9 +200,6 @@ struct arch_vcpu { struct page_info* vhpt_page; unsigned long vhpt_entries; #endif -#ifdef CONFIG_XEN_IA64_TLBFLUSH_CLOCK - u32 tlbflush_timestamp; -#endif #define INVALID_PROCESSOR INT_MAX int last_processor; };